package com.highcom.mapper;

import com.highcom.bean.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StudentMapper {

    @Select("select * from student")
    public List<Student> selectAll();
    //根据id 查学生
    @Select("select * from student where id = #{id}")
    public Student selectById(Integer id);


    //添加学生
    @Insert("insert into student values (#{id},#{name},#{age})")
    public Integer insert(Student student);


//    @Insert("insert into student values (#{id},#{name},#{age})")
//    public Integer insert2(@Param("id")Integer id,@Param("name")String name,@Param("age")Integer age);

    //删除学生
    @Delete("delete from student where id = #{id}")
    public Integer delete(Integer id);

}
